// sub.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    currTitle:'',
    list:[],
    songid:''
  },
  toplay:function(event){
    // console.log(event);
    var obj = event.currentTarget.dataset.song;
    getApp().globalData.songmsg=obj;
    // this.setData({
    //   songmsg :obj
    // })
    wx.switchTab({
      url: '../play/play'
    })
  },
  /**
  * 生命周期函数--监听页面加载
  */
  onShow: function (options) {
    console.log(2222222222);
    // var id = options.id;
    var that = this;
    var title = getApp().globalData.title;
  
    var id = getApp().globalData.songId;
    wx.request({
      url: "https://route.showapi.com/213-4", 
      data: {
        showapi_appid: 41290,
        showapi_sign: "d395a1c332314f8587ce9db0ebaf751c",
        topid: id
      },
      method: "GET",
      success: function (res) {
        // console.log(res);
        var datas = res.data;
        if (datas.showapi_res_code==0){
          // wx.onReachBottom = function(){

          // }
          that.setData({
            list: datas.showapi_res_body.pagebean.songlist,
            songid: id,
            currTitle:title
          })    
        }
      }
    })
  }
})